<?php declare(strict_types=1);


namespace App\Service;

use App\Dao\PackDownLogDao;
use App\Logic\CommonLogic;
use Hyperf\Di\Annotation\Inject;

class PackDownLogService
{
    /**
     * @Inject()
     * @var PackDownLogDao
     */
    protected $dao;

    /**
     *
     * @param $hash
     * @return \Hyperf\Database\Model\Builder|\Hyperf\Database\Model\Model|object
     * @throws \App\Exception\DaoException
     */
    public function download($hash)
    {
        $file = $this->dao->findByHas($hash);
        CommonLogic::check($file->path,'文件丢失');
        return $file;
    }
}